from common.client import RequestsClient

class BaseBuyerApi(RequestsClient):
    buyer_token = ''
    def __init__(self):
        super().__init__()
        self.url = 'http://59.36.173.55:7002'
        self.headers = {
            "Authorization":BaseBuyerApi.buyer_token
        }

class BaseSellerApi(RequestsClient):
    seller_token = ''
    def __init__(self):
        super().__init__()
        self.url = 'http://59.36.173.55:7002'
        self.headers = {
            "Authorization":BaseSellerApi.seller_token
        }

class BaseManagerApi(RequestsClient):
    # 这是定义的全局性的类属性，来代表买家token，默认是空
    # token提取赋值是在测试之前要完成的，最终会在自定义的fixture中完成
    manager_token = ''
    def __init__(self):
        super().__init__() # 表示继承父类所有的属性
        self.url = 'http://59.36.173.55:7002'
        self.headers = {
            "Authorization":BaseManagerApi.manager_token
        }

# 基础服务基类
class BaseBasicApi(RequestsClient):

    def __init__(self):
        super().__init__() # 表示继承父类所有的属性
        self.url = 'http://59.36.173.55:7002'

